import { defineConfig, rspack } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { tanstackRouter } from '@tanstack/router-plugin/rspack'
export default defineConfig({
  server: {
    port: 6030,
    proxy: {
      /* '/api':{
        target: 'http://localhost:7001',
        changeOrigin: true,
        secure: false,
        ws: true,
        pathRewrite: { '^/api': '/api' },
      } */
    }
  },
  source: {
    entry: { index: './src/main.tsx' }
  },
  html: {
    title: '报表引擎编辑器',
  },
  plugins: [pluginReact()],
  tools: {

    rspack: {
      plugins: [
        tanstackRouter({
          target: 'react',
          autoCodeSplitting: true
        })
      ]
    }
  }
});
